<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>多个状态值</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
    </style>
</head>
<body>
	<div class="container">
		<h1>多个状态值</h1>
	</div>
	<script src="./promise.js"></script>
	<script type="text/javascript">
	 // 多个状态值.html
	 // 
	 
	 var p1 = new Promise((resolve, reject) => {
	 	var n = Math.round(Math.random()) ;

	 	if( n ) {
	 		resolve(n, 'success', true, null, new Date() )
	 	} else {
	 		reject(n, 'failed', true, null, new Date() )
	 	}
	 })

	 // 正常的版本 then 回调只能处理一个值 
	 // 因为 [[PromiseResult]] 只能保存单个值
	 p1.then((value, arg2, arg3, arg4, arg5, arg6) => {
	 	console.log(value, arg2, arg3, arg4, arg5, arg6)
	 }, (reason, arg2, arg3, arg4, arg5, arg6) => {
	 	console.warn(reason, arg2, arg3, arg4, arg5, arg6)
	 })
	 console.log(p1)
	</script>
</body>
</html>